<html>
<head>
    <meta charset="UTF-8">
    <title>文件上传</title>
    {load href="__CSS__/bootstrap.min.css"/}
    {load href="__CSS__/elpis.min.css"/}
    {load href="__JS__/jquery-1.10.2.min.js"/}
    {load href="__JS__/bootstrap.bundle.min.js"/}
    <script type="text/javascript" src="__JS__/jquery.form.min.js"></script>
    <script type="text/javascript" src="__STATIC__/layer/layer.js"></script>
</head>
<body>

<div class="card-body">
    <form id="myform" class="form-horizontal" action="{:U($model_name.'/remove')}" method="post">
        <input type="hidden" name="modelid" value="{$modelid}">
        <input type='hidden' name="id" value='{$id}'>
        <div class="form-group">
            <label class="form-control-label col-2">选择栏目</label>
            <div class="col-8">
                <select name="catid" class="form-control move_catid">
                    <option value="">修改栏目</option>
                    {$select_categorys}
                </select>
            </div>
        </div>
        <div class="card-footer">
            <button type="button" class="btn btn-default btn-sm">取消</button>
            <button type="submit" class="btn btn-primary btn-sm">确认</button>
        </div>
    </form>
</div>
<script>
    var index = parent.layer.getFrameIndex(window.name); //获取窗口索引

    $(document).ready(function() {
        $('#myform').ajaxForm({
            success:  complete,  // post-submit callback
            dataType: 'json'
        });
    });

    function complete(data){
        if (data.status == 1) {
            layer.msg(data.info, {
                icon: 1,
                time: 1000 //2秒关闭（如果不配置，默认是3秒）
            });
            setTimeout(function(){
                parent.location.reload();
                parent.layer.close(index);
            },1000);
        } else {
            layer.msg(data.info, {
                icon: 2,
                time: 2000 //2秒关闭（如果不配置，默认是3秒）
            });
        }
    }
</script>
</body>